import globalPostRequest from "@/request/globalPostRequest.js";

/**
 * 角色：社会单位
 * 功能：为社会单位所关联的服务机构评分时，查询所关联的服务机构列表
 * @returns
 */
export function getAssociationServerListApi(data, callback) {
  return globalPostRequest({
    url: `/dInstitutionServiceEvaluations/page/agency/current-year/${data.userId}?pageSize=${data.pageSize}&pageNo=${data.pageNo}`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    callback,
  });
}
/**
 * 角色：社会单位
 * 功能：为社会单位所关联的服务机构评分
 * @returns
 */
export function getAssociationServerAddApi(data, callback) {
  return globalPostRequest({
    url: `/dInstitutionServiceEvaluations/add`,
    method: "post",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：社会单位
 * 功能：为社会单位所关联的服务机构中执业人员评分
 * @returns
 */
export function getAssocEvaluationsServerApi(data, callback) {
  return globalPostRequest({
    url: `/personnel-service-evaluations/create`,
    method: "post",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：社会单位
 * 功能：为社会单位所关联的服务机构评分，查询默认评分项的评分数
 * @returns
 */
export function getAgencyListApi(agencyId, callback) {
  return globalPostRequest({
    url: `/dInstitutionServiceEvaluations/agency/${agencyId}`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    callback,
  });
}

/**
 * 角色：社会单位
 * 功能：查询社会单位已评价的服务机构列表
 * @returns
 */
export function getInstitutionListApi(data, callback) {
  return globalPostRequest({
    url: `/dInstitutionServiceEvaluations/pageQuery`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：社会单位
 * 功能：查询社会单位已评价的服务机构中的执业人员列表
 * @returns
 */
export function getInstEvaluationsListApi(data, callback) {
  return globalPostRequest({
    url: `/personnel-service-evaluations/page/my-project/current-year`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：社会单位
 * 功能：工作台-
 * @returns
 */
export function getInstitutionUnitApi(data, callback) {
  return globalPostRequest({
    url: `/dInstitutionServiceEvaluations/page/unit`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：执业人员
 * 功能：查询执业人员已评价的服务机构列表
 * @returns
 */
export function getInstEvaluationsListApis(data, callback) {
  return globalPostRequest({
    url: `/personnel-service-evaluations/page`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}

/**
 * 角色：执业人员
 * 功能：查询执业人员自身评价信息
 * @returns
 */
export function getInstEvaluationsInfoApis(data, callback) {
  return globalPostRequest({
    url: `/personnel-service-evaluations/staffUserId`,
    method: "get",
    header: {
      "content-type": "application/json;charset=UTF-8",
    },
    data,
    callback,
  });
}
